package com.hhj.sharding.sphere.demo.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hhj.sharding.sphere.demo.base.PageVO;
import com.hhj.sharding.sphere.demo.mapper.SingleTable2Mapper;
import com.hhj.sharding.sphere.demo.mapper.SingleTableMapper;
import com.hhj.sharding.sphere.demo.model.Table2ParamVO;
import com.hhj.sharding.sphere.demo.model.TableParamVO;
import com.hhj.sharding.sphere.demo.model.entity.SingleTable;
import com.hhj.sharding.sphere.demo.model.entity.SingleTable2;
import com.hhj.sharding.sphere.demo.service.ISingleTable2Service;
import com.hhj.sharding.sphere.demo.service.ISingleTableService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author HHJ
 * @since 2024-05-22
 */
@Service
public class Single2TableServiceImpl extends ServiceImpl<SingleTable2Mapper, SingleTable2> implements ISingleTable2Service {

    @Override
    public PageVO findPage(Table2ParamVO req) {
        // 分页插件_new
        Page page = new Page(req.getPageNum(), req.getPageSize());
        List<SingleTable2> list = baseMapper.findList(page, req);
        return new PageVO(Long.valueOf(page.getCurrent()), Long.valueOf(page.getSize()), page.getTotal(), list);
    }
}
